package com.jiuzhou.guanwang.jzcp;

import android.app.Application;
import android.util.Log;

import com.vise.log.ViseLog;
import com.vise.log.inner.LogcatTree;

import org.xutils.x;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by ydd on 2017/4/11.
 */

public class BaseApplication extends Application {
    public static BaseApplication mInstance = null;
    @Override
    public void onCreate() {
        super.onCreate();
        mInstance = this;
        initNet();
        initLog();
        JPushInterface.setDebugMode(true);
        JPushInterface.init(this);
    }

    private void initLog() {

        ViseLog.getLogConfig()
                .configAllowLog(true)//是否输出日志
                .configShowBorders(true)//是否排版显示
                .configTagPrefix("ViseLog")//设置标签前缀
                .configFormatTag("%d{HH:mm:ss:SSS} %t %c{-5}")//个性化设置标签，默认显示包名
                .configLevel(Log.VERBOSE);//设置日志最小输出级别，默认Log.VERBOSE
        ViseLog.plant(new LogcatTree());//添加打印日志信息到Logcat的树
    }
    private void initNet() {
        x.Ext.init(this);
    }
    /**
     * Application  单例
     *
     * @return
     */
    public static BaseApplication getInstance() {
        return mInstance;
    }

}
